﻿	CREATE TABLE EDWEN.ACC_LIST 
	     (
	      ADDR_ID INTEGER NOT NULL PRIMARY KEY,
	      SFH_ID CHAR(10),
	      TRAC_ID CHAR(8),
	      STREET_NUM VARCHAR(100),
	      STREET_NAME VARCHAR(100),
	      UNIT_NUM VARCHAR(20),
	      CITY VARCHAR(40),
	      STATE_CD CHAR(2),
			FOREIGN KEY REFERENCES VEDWEN.STATELIST(STATE_CD),
	      ZIP_1_5_CD CHAR(5),
	      ACTIVE CHAR(1) DEFAULT 'N',
	      PMASTER_ADDR_ID INTEGER,
	      ELU_ID VARCHAR(30),
	      BAN VARCHAR(10),
	      WIRE_CTR_CD CHAR(8) DEFAULT '        ',
	      LUID VARCHAR(10),
	      DA_CD VARCHAR(6),
	CONSTRAINT ID_PK PRIMARY KEY ( ADDR_ID ))

	CREATE TABLE SCORE.SALES_ORDERS
	     (	REGION VARCHAR(100),
			STATE VARCHAR(100),
			WIRE_CENTER VARCHAR(100),
			PROPERTY_ID VARCHAR(100) NOT NULL PRIMARY KEY,
			NATIONAL_IND VARCHAR(100),
			DWELLING_TYPE VARCHAR(100),
			ADDRESS VARCHAR(100),
			UNIT VARCHAR(100),
			CITY_NM VARCHAR(100),
			REGION_DESC VARCHAR(100),
			SEGMENT VARCHAR(100),
			PROPERTY_NAME VARCHAR(100),
			AM VARCHAR(100),
			AE_ASSIGNED VARCHAR(100),
			PORTFOLIO_NAME VARCHAR(100),
			PR_STATUS VARCHAR(100),
			C_STATUS VARCHAR(100),
			MARKET_AREA VARCHAR(100),
			DA VARCHAR(100),
			WCDA VARCHAR(100),
			EVENT_ID VARCHAR(100),
			SONBR VARCHAR(100),
			DISC_RSN_CD VARCHAR(100),
			DISC_RSN    VARCHAR(100),
			SALES_CODE VARCHAR(100),
			DIST_CHANNEL VARCHAR(100),
			BAN VARCHAR(100),
			ORDER_TYPE VARCHAR(100),
			SOURCE_CD VARCHAR(100),
			POSTDATE DATETIME,
			PRODUCT_ID VARCHAR(100),
			PRODUCT_NM        VARCHAR(100),
			INWARD_OUTWARD_CD          VARCHAR(100),
			PRODUCT_ACTION_CD   VARCHAR(100),
			PROD_QTY   INT
)

	CREATE TABLE ACC_CHANNEL_ROLLUPS.REGION
	     (	REGION VARCHAR(100),
			PRODUCT    VARCHAR(100),
			FEATURE    VARCHAR(100),
			ALTCHNL_IN INT, 
			ALTCHNL_PCT DECIMAL,   
			ALTCHNL_OUT INT, 
			COR_IN INT, 
			COR_PCT DECIMAL,   
			COR_OUT INT, 
			CS_IN INT, 
			CS_PCT DECIMAL,   
			CS_OUT INT, 
			D2D_IN INT, 
			D2D_PCT DECIMAL,   
			D2D_OUT INT, 
			MOBILITYDMD_IN INT, 
			MOBILITYDMD_PCT DECIMAL,   
			MOBILITYDMD_OUT INT, 
			NATIONALRET_IN INT, 
			NATIONALRET_PCT DECIMAL,   
			NATIONALRET_OUT INT, 
			OBTM_IN INT, 
			OBTM_PCT DECIMAL,   
			OBTM_OUT INT, 
			ONLINE_IN INT, 
			ONLINE_PCT DECIMAL,   
			ONLINE_OUT INT, 
			P2RCALLCEN_IN INT, 
			P2RCALLCEN_PCT DECIMAL,   
			P2RCALLCEN_OUT INT, 
			STORES_IN INT, 
			STORES_PCT DECIMAL,   
			STORES_OUT INT, 
			TE_IN INT, 
			TE_PCT DECIMAL,   
			TE_OUT INT, 
			WEB_IN INT, 
			WEB_PCT DECIMAL,   
			WEB_OUT INT, 
			TOT INT, 
			ROLLUP_TYPE VARCHAR(100)
		)

